//
//  LOLFirstPager.m
//  LOL_Little_Box
//
//  Created by dllo on 16/3/23.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LOLFirstPager.h"
#import "LOLNewViewController.h"
#import "LOLEventViewController.h"
#import "LOLVideoViewController.h"
#import "LOLEntertainmentViewController.h"
#import "LOLOfficialViewController.h"
#import "LOLStrategyViewController.h"
#import "LOLActivityViewController.h"
#import "LOLSegmentView.h"
@interface LOLFirstPager ()<LOLSegmentViewDelegate>
@property (nonatomic, retain)NSArray *titleArr;
@end

@implementation LOLFirstPager


- (void)viewDidLoad {
    [super viewDidLoad];
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.navigationController.navigationBarHidden = YES;
    self.titleArr = @[@"最新", @"赛事", @"视频", @"娱乐", @"官方", @"美女", @"攻略", @"活动"];
     NSArray * controllerNameArray = @[@"LOLNewViewController",@"LOLEventViewController",@"LOLVideoViewController",@"LOLEntertainmentViewController",@"LOLOfficialViewController",@"LOLStrategyViewController",@"LOLActivityViewController"];
    //传入对应controler的名字与title即可。实现各个页面对应一个control方便数据请求与逻辑实现。
    LOLSegmentView * segmentView = [[LOLSegmentView alloc]initWithFrame:CGRectMake(0, 20, SCREENW, SCREENH) andHeaderHeight:40.f andTitleArray:_titleArr andShowControllerNameArray:controllerNameArray];
    segmentView.delegate = self;
    [self.view addSubview:segmentView];
    NSLog(@"%lf~~~~%lf  %lf%lf", segmentView.frame.origin.x, segmentView.frame.origin.y, segmentView.frame.size.width, segmentView.frame.size.height);
}
- (void)didSelectIndex:(NSInteger)index{
    NSLog(@"%ld", index);
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any self.navigationController.navigationBar.hidden = YES; that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
